<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
<title>系统日志浏览</title>
<c:import url="/WEB-INF/jsp/head.jsp" />
<c:import url="/WEB-INF/jsp/plugin/datetimepicker.jsp" />
<script type="text/javascript" src="static/js/sys/logList.js"></script>
</head>
<body>
	<div class="default-theme container-fluid iframe">
		<div class="col-md-12">
			<div class="panel panel-default">
				<div class="panel-heading">搜索条件</div>
				<div class="panel-body">
					<form class="form-inline" action="system/logList" method="post">
						<div class="form-group">
							<label for="type.value">日志类型：</label> <select name="type.value"
								class="form-control">
								<option value="">所有</option>
								<c:forEach items="#{logTypes }" var="type">
									<option value="${type.value }"
										<c:if test="${logType == type.value }">selected="selected"</c:if>>${type.name }</option>
								</c:forEach>
							</select>
						</div>
						<div class="form-group">
							<label for="startDate">日志时间：</label>
							<div class="input-group date">
								<input type="text" name="startDate"
									class="form-control text-center date" readonly="readonly"
									placeholder="起始时间"
									value="<fmt:formatDate pattern="yyyy-MM-dd" 
            					value="${dateCondition.startDate}" />">
								<div class="input-group-addon">至</div>
								<input type="text" name="endDate"
									class="form-control text-center date" readonly="readonly"
									placeholder="结束时间"
									value="<fmt:formatDate pattern="yyyy-MM-dd" 
            					value="${dateCondition.endDate}" />">
							</div>
						</div>
						<input type="hidden" id="pageNum" name="pageNum" />
						<button type="submit" class="btn btn-default">搜索</button>
					</form>
				</div>
			</div>
		</div>
		<div class="col-md-12">
			<table class="table table-hover table-border">
				<thead>
					<tr>
						<th style="min-width: 6rem;">操作人</th>
						<th style="min-width: 6rem;">操作类型</th>
						<th style="min-width: 16rem;">日志内容</th>
						<th style="min-width: 12rem;">操作时间</th>
					</tr>
				</thead>
				<tbody>
					<c:if test="${fn:length(pageInfo.list) == 0 }">
						<tr align="center">
							<td colspan="5">没有查询到数据</td>
						</tr>
					</c:if>
					<c:forEach items="${pageInfo.list }" var="log">
						<tr>
							<td>${log.teacher.account }</td>
							<td>${log.type.name }</td>
							<td>${log.content }</td>
							<td><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss"
									value="${log.createDate}" /></td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<c:import url="/WEB-INF/jsp/paging.jsp" />
		</div>
	</div>
</body>
</html>